@if (_posts != null)
{
    <MudSelect Label="Roles" T="string" SelectedValues="SelectedValues" MultiSelection="true">
        @foreach (var role in _posts)
        {
            <MudSelectItem T="string" Value="@role">@role</MudSelectItem>
        }
    </MudSelect>
}


@code
{
    private IEnumerable<string> SelectedValues { get; set; } = new HashSet<string>()
    { 
        "Programista", "test"
    };

    private HashSet<string> _posts;

    protected override void OnInitialized()
    {
        _posts = new HashSet<string>
        {
            "Programista", "Programista 2", "test", "Technik", "Tester", "Tester tester"
        };
    }
}